// 设置基本的opthions
function setOptions(method = 'GET', param) {
  const token = sessionStorage.getItem('token')
  const token1 = 'eyJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJsZW9wYXJkIiwianRpIjoiMzAiLCJzdWIiOiJzdXBlckFkbWluIiwiaWF0IjoxNTk2NTA0Nzk1LCJleHAiOjE1OTY1NDc5OTV9.vNqHMREAtt9xLHYNM3HozMWvvSf0L4VtEbPvhV6IrnMFenjeaXu-IOHLojGNtNHfxFcSzINzQfnzbWqpMpRaOg'
  const options = {
    method: method,
    headers: {
      // 'Content-Type': 'application/json',
      Authorization: token ? token : token1,
    },
    // handleAs: 'json',
  };
  if (param) {
    options.body = JSON.stringify(param);
  }
  return options;
}

export default setOptions


